<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>登入 - ${global.sys_title}</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" href="${basepath}/plugin/layui/css/layui.css" media="all">
		<link rel="stylesheet" href="${basepath}/layuiadmin/style/admin.css" media="all">
		<link rel="stylesheet" href="${basepath}/layuiadmin/style/login.css" media="all">
		<link rel="stylesheet" href="${basepath}/layuiadmin/style/layer.css" media="all">
		<style id="LAY_layadmin_theme">
		.layui-side-menu,
			.layadmin-pagetabs .layui-tab-title li:after,
			.layadmin-pagetabs .layui-tab-title li.layui-this:after,
			.layui-layer-admin .layui-layer-title,
			.layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child {
				background-color: #3A3D49 !important;
			}
			
			.layui-nav-tree .layui-this,
			.layui-nav-tree .layui-this>a,
			.layui-nav-tree .layui-nav-child dd.layui-this,
			.layui-nav-tree .layui-nav-child dd.layui-this a {
				background-color: #5FB878 !important;
			}
			
			.layui-layout-admin .layui-logo {
				background-color: #2F9688 !important;
			}
		}
		</style>

	</head>

	<body layadmin-themealias="green" >
		<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">
			<div class="layadmin-user-login-main">
				<div class="layadmin-user-login-box layadmin-user-login-header">
					<h2>${global.sys_title}</h2>
				</div>
				<form id="passwordForm" method="post" onkeydown="submitByEnter();">
					<div class="layadmin-user-login-box layadmin-user-login-body layui-form">
						<div class="layui-form-item">
							<label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
							<input type="text" name="admin.username" id="LAY-user-login-username" lay-verify="required" placeholder="用户名" class="layui-input">
							<input type="hidden" id="go_url" name="go" value="${go!}">
						</div>
						<div class="layui-form-item">
							<label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
							<input type="password" name="admin.password" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
						</div>
						<div class="layui-form-item">
							<div class="layui-row">
								<div class="layui-col-xs7">
									<label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
									<input type="text" name="code" id="LAY-user-login-vercode" lay-verify="required" placeholder="图形验证码" class="layui-input">
								</div>
								<div class="layui-col-xs5">
									<div style="margin-left: 10px;">
										<!-- <img src="./登入 - layuiAdmin_files/captcha" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode"> -->
										<img class="layadmin-user-login-codeimg" alt="点击切换验证码" src="/system/login/code" onclick="this.src='/system/login/code?x='+Math.random() ">

									</div>
								</div>
							</div>
						</div>
						<div class="layui-form-item" style="margin-bottom: 20px;">
							<input type="checkbox" name="remember" value="save_login" lay-skin="primary" title="七天免登陆">
							<div class="layui-unselect layui-form-checkbox" lay-skin="primary">
								<span>七天免登陆</span>
								<i class="layui-icon"></i>
							</div>

						</div>
						<div class="layui-form-item">
							<button id="sub_btn" type="button" class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit">登 入</button>
						</div>
					</div>
				</form>
			</div>
			<div class="layui-trans layadmin-user-login-footer">
				<p>
					© 2018
					<a href="http://www.gexinit.com/" target="_blank">上海格欣信息技术有限公司</a>
				</p>

			</div>
		</div>
		<script src="${basepath}/plugin/jquery.js"></script>
		<script src="${basepath}/plugin/layui/layui.all.js"></script>
		<script src="${basepath}/gexinadmin/common.js"></script>
		<script>
			//禁止滚动条
			$(document.body).css({
				"overflow-x": "hidden",
				"overflow-y": "hidden"
			});

			function submitByEnter() {
				if(event.keyCode == 13) {
					$("#sub_btn").trigger("click");
				}
			}

			if(window.top !== window.self) {
				window.top.location = window.location
			};
			var form = layui.form
			//提交
			form.on('submit(LAY-user-login-submit)', function(obj) {
				url = "/system/login/post";
				Ajax(url, obj.field, function(ret) {
					if(ret.state) {
						if($("#go_url").val() != "") {
							//window.location.replace($("#go_url").val());
							window.location.replace("/system/index?go=" + $("#go_url").val());
						} else {
							layer.msg('登入成功', {
								offset: '15px',
								icon: 1,
								time: 1000
							}, function() {
								window.location.replace("/system/index"); //后台主页
							});

						}
					} else {
						layer.msg(ret.msg);
						$("img").trigger("click");
					}

				});
			});
		</script>

		<div class="layui-layer-move"></div>
	</body>

</html>